package com.mayikt.member.api.service;

import com.mayikt.base.BaseResponse;
import com.mayikt.member.api.dto.resp.UserRespDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Api(tags = "会员服务基本信息接口")
public interface MemberInfoService {

    @GetMapping("/getTokenUser")
    @ApiOperation("根据token查看用户信息")
    @ApiImplicitParam(name = "token", value = "token", required = true)
    BaseResponse getTokenUser(@RequestParam("token") String token);

    @PostMapping("/updateUseOpenId")
    @ApiOperation("关联用户的openid")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户ID", required = true),
            @ApiImplicitParam(name = "openId", value = "微信公众号用户公众ID", required = false)
    })
    BaseResponse updateUseOpenId(@RequestParam("userId") Long userId,
                                         @RequestParam(name = "openId", required = false) String openId);

    @GetMapping("/selectByOpenId")
    @ApiOperation("根据openid 查询用户信息")
    @ApiImplicitParam(name = "openId", value = "微信公众号用户公众ID", required = true)
    BaseResponse selectByOpenId(@RequestParam("openId") String openId);

    @GetMapping("/cancelFollowOpenId")
    @ApiOperation("取消关注")
    @ApiImplicitParam(name = "openId", value = "微信公众号用户公众ID", required = true)
    BaseResponse cancelFollowOpenId(@RequestParam("openId") String openId);
}
